"aggregate Psychopy .csv files in directory"

import glob

alldata = open('aggregate_Task_raw.csv','w')

for f in glob.glob('*.csv'):
    openfile = open(f, 'r')
    openfile.readline()

    rawtext = openfile.read()

    for i in rawtext.split('\r\n'):
        alldata.write(i + '\n')
        
print 'All Done!'

alldata.close()
